package object4.package5;



public class Test {
    //两种写法
    public static void main(String[] args) {
//        Animal animal = new Cat("小猫");
//        System.out.println(animal.getName());
//        IRunning iRunning = new Cat("小猫");
//        iRunning.run();

//        Cat cat = new Cat("小猫");
//        System.out.println(cat.getName());
//        cat.run();

//        Fish fish = new Fish("小鱼");
//        System.out.println(fish.getName());
//        fish.swim();
//
        Frog frog = new Frog("青蛙");
        System.out.println(frog.getName());
        frog.run();
        frog.swim();
//
//        Duck duck = new Duck("鸭子");
//        System.out.println(duck.getName());
//        duck.fly();
//        duck.run();
//        duck.swim();
    }
}
